package cn.blb.service.vod.controller;

import cn.blb.common.result.Result;
import cn.blb.service.vod.service.VodService;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@RestController
@CrossOrigin
@RequestMapping("/vod/video")
public class VodController {
    private final VodService vodService;

    public VodController(VodService vodService) {
        this.vodService = vodService;
    }


    @PostMapping("/upload")
    public Result upload(MultipartFile file) {
        String videoId = vodService.upload(file);
        return Result.ok().setData("item", videoId);
    }
}

